﻿@using LKVService
@using LKVMLMLib;
@{
    var extenssion = new LKVService.User();
    var configParent = extenssion.getConfigTree();
    if (configParent.Option_1 == true)
    {

        ViewBag.a = "1";
    }
    if (configParent.Option_2 == true)
    {
        ViewBag.b = "2";
    }
    var Profitservice = new LKVService.ProfitService();
    var ListCommission = Profitservice.getListCommissionConfig(true, false);
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Giao diện Admin</title>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <link href="~/Asset/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Asset/bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
    <link href="~/Asset/dist/css/timeline.css" rel="stylesheet" />
    <link href="~/Asset/dist/css/sb-admin-2.css" rel="stylesheet">
    <link href="~/Asset/bower_components/morrisjs/morris.css" rel="stylesheet">
    <link href="~/Asset/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <script src="~/Scripts/jquery-1.9.1.js"></script>
    <script src="~/Asset/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="~/Asset/bower_components/metisMenu/dist/metisMenu.min.js"></script>
    <script src="~/Asset/dist/js/sb-admin-2.js"></script>
    <link href="~/Content/css/tree/styleTree.css" rel="stylesheet" />
    <link href="~/Content/css/tree/styleTree.min.css" rel="stylesheet" />
    @Styles.Render("~/Content/jupload")
    <style>
        .custom-combobox {
            position: relative;
            display: inline-block;
            top: 0;
            bottom: 0;
            margin-left: -1px;
            padding: 0;
            / support: IE7 / *height: 1.7em;
            *top: 0.1em;
        }

        .custom-combobox-toggle {
            position: absolute;
            top: 0;
            bottom: 0;
            margin-left: -1px;
            padding: 0;
            / support: IE7 / *height: 1.7em;
            *top: 0.1em;
        }

        .custom-combobox-input {
            margin: 0;
            /*padding: 0.3em;*/
        }
    </style>
</head>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="@Url.Action("Dashboard", "Account")">DashBoard</a>
            </div>
            <!-- /.navbar-header -->
            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-envelope fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-messages">
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>Read All Messages</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                    <!-- /.dropdown-messages -->
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li>
                            <a href="@Url.Action("Userprofile", "Account")"><i class="fa fa-user fa-fw"></i>Thông tin cá nhân</a>
                        </li>
                        <li>
                            <a href="@Url.Action("ChangePass", "Account")"><i class="fa fa-edit fa-fw"></i>Đổi mật khẩu</a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="@Url.Action("Login", "Account")"><i class="fa fa-sign-out fa-fw"></i>Thoát</a>
                        </li>
                    </ul>
                </li>
            </ul>
            <div class="navbar-default sidebar" role="navigation">
                @if(Session["User"] != null)
                {
                    var admin = (UserProfile)Session["User"];
                    if(admin.GruopID == 3)
                    { 
                         <div class="sidebar-nav navbar-collapse">
                        <ul class="nav" id="side-menu">
                            <li>
                                <a href="forms.html"><i class="fa fa-user  fa-fw"></i> Thành viên<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href="@Url.Action("ListUser", "User")">Danh sách thành viên</a>
                                    </li>
                                    <li>
                                        <a href="@Url.Action("Group", "User")">Danh sách nhóm</a>
                                    </li>
                                    @if (ViewBag.a == "1")
                                    {
                                        <li>
                                            <a href="@Url.Action("SystemTree", "User")">Cây hệ thống</a>
                                        </li>
                                    }
                                    @if (ViewBag.b == "2")
                                    {
                                        <li>
                                            <a href="@Url.Action("BinaryTree", "User")">Cây nhị phân</a>
                                        </li>
                                    }
                                </ul>
                            </li>
                            <li>
                                <a href="forms.html"><i class="fa fa-exchange" fa-fw"></i> Quản lý PH-GH<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href="@Url.Action("ListBadPH","ProvideHelp")">Quản lý Bad Report</a>
                                    </li>
                                    <li>
                                        <a href="@Url.Action("ListPH", "ProvideHelp")">Quản lý PH</a>
                                    </li>
                                    <li>
                                        <a href="@Url.Action("ListGH", "GetHelp")">Quản lý GH</a>
                                    </li>
                                    <li>
                                        <a href="@Url.Action("Prioritize","GetHelp")">GH Ưu tiên</a>
                                    </li>
                                </ul>
                            </li>
                            <li>
                                <a href="forms.html"><i class="fa fa-table fa-fw"></i> Package<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href="@Url.Action("DoanhSo", "Order")">List</a>
                                    </li>

                                </ul>
                            </li>
                            <li>
                                <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Lịch sử trả thưởng<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href="@Url.Action("Commission", "Profit")">Danh sách</a>
                                    </li>

                                </ul>
                            </li>
                            <li>
                                <a href="forms.html"><i class="fa fa-code fa-fw"></i> Pin manager  <span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href="@Url.Action("DanhSachPin", "CongCu")">Pin Daily</a>
                                    </li>

                                </ul>
                            </li>
                            <li>
                                <a href="forms.html"><i class="fa fa-credit-card fa-fw"></i> Withdraw<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href="@Url.Action("ListWd","GetHelp")">Withdraw manager</a>
                                    </li>
                                </ul>
                            </li>
                            @*<li>
                                    <a href="forms.html"><i class="fa  fa-paste fa-fw "></i> Module<span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                       @foreach (var item in ListCommission)
                                        {
                                         <li>
                                             @if (Session["User"] != null)
                                             {
                                             <a href="@HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority)@Url.Content(@"~/")@item.CommissionName.Substring(7)/Index">
                                                @item.CommissionDesc
                                             </a>
                                             }
                                        </li>
                                       }

                                    </ul>
                                </li>
                                <li>
                                    <a href="forms.html"><i class="fa fa-gear fa-fw"></i> Cấu hình<span class="fa arrow"></span></a>
                                    <ul class="nav nav-second-level">
                                        <li>
                                            <a href="@Url.Action("CauHinhHoaHong", "CongCu")">Cấu hình hoa hồng</a>
                                        </li>
                                    </ul>
                                </li>*@
                            <li>
                                <a href="forms.html"><i class="fa fa-wrench fa-fw"></i> Công cụ<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href="@Url.Action("PinManager","CongCu")">Add Pin</a>
                                    </li>
                                </ul>
                            </li>

                        </ul>
                    </div>
                    }
                }
            </div>
        </nav>
        <div id="page-wrapper" style="padding-top:10px;">
            @RenderBody()
        </div>
    </div>
    @Scripts.Render("~/bundles/loadData")
    @Scripts.Render("~/bundles/tree")
    @Scripts.Render("~/bundles/jupload")
    <script src="~/tinymce/tinymce.min.js"></script>
    <script type="text/javascript">

        $('.confir').on('click', function () {
            return confirm('bạn có chắc chắn Reset Data Lưu ý dữ liệu sẽ mất hết và không thể phục hồi?');
        });
        $('.Backup').on('click', function () {
            return confirm('bạn có chắc chắn muốn Sao Lưu dữ liệu?');
        });
        $('.Restore').on('click', function () {
            return confirm('bạn có chắc chắn muốn Khôi phục dữ liệu?');
        });
        $('.delUser').on('click', function () {
            return confirm('Bạn có chắc chắn xóa thành viên này ?');
        });
        tinyMCE.init({
            selector: "#txtContent",
            theme: "modern",
            plugins: [
                "advlist autolink lists link image charmap print preview hr anchor pagebreak",
                "searchreplace wordcount visualblocks visualchars code fullscreen",
                "insertdatetime media nonbreaking save table contextmenu directionality",
                "emoticons template paste textcolor colorpicker textpattern imagetools"
            ],
            toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
            toolbar2: "print preview media | forecolor backcolor emoticons",
            image_advtab: true,
            templates: [
                { title: 'Test template 1', content: 'Test 1' },
                { title: 'Test template 2', content: 'Test 2' }
            ]
        });
    </script>
    <script src="~/Scripts/jquery-ui.js"></script>
    <link href="~/Scripts/jquery-ui.css" rel="stylesheet" />
    <script>
        (function ($) {
            $.widget("custom.combobox", {
                _create: function () {
                    this.wrapper = $("<span>")
                      .addClass("custom-combobox")
                      .insertAfter(this.element);

                    this.element.hide();
                    this._createAutocomplete();
                    this._createShowAllButton();
                },

                _createAutocomplete: function () {
                    var selected = this.element.children(":selected"),
                      value = selected.val() ? selected.text() : "";

                    this.input = $("<input>")
                      .appendTo(this.wrapper)
                      .val(value)
                      .attr("title", "")
                      .addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left")
                      .autocomplete({
                          delay: 0,
                          minLength: 0,
                          source: $.proxy(this, "_source")
                      })
                      .tooltip({
                          tooltipClass: "ui-state-highlight"
                      });

                    this._on(this.input, {
                        autocompleteselect: function (event, ui) {
                            ui.item.option.selected = true;
                            this._trigger("select", event, {
                                item: ui.item.option
                            });
                        },

                        autocompletechange: "_removeIfInvalid"
                    });
                },

                _createShowAllButton: function () {
                    var input = this.input,
                      wasOpen = false;

                    $("<a>")
                      .attr("tabIndex", -1)
                      .attr("title", "Show All Items")
                      .tooltip()
                      .appendTo(this.wrapper)
                      .button({
                          icons: {
                              primary: "ui-icon-triangle-1-s"
                          },
                          text: false
                      })
                      .removeClass("ui-corner-all")
                      .addClass("custom-combobox-toggle ui-corner-right")
                      .mousedown(function () {
                          wasOpen = input.autocomplete("widget").is(":visible");
                      })
                      .click(function () {
                          input.focus();

                          // Close if already visible
                          if (wasOpen) {
                              return;
                          }

                          // Pass empty string as value to search for, displaying all results
                          input.autocomplete("search", "");
                      });
                },

                _source: function (request, response) {
                    var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
                    response(this.element.children("option").map(function () {
                        var text = $(this).text();
                        if (this.value && (!request.term || matcher.test(text)))
                            return {
                                label: text,
                                value: text,
                                option: this
                            };
                    }));
                },

                _removeIfInvalid: function (event, ui) {

                    // Selected an item, nothing to do
                    if (ui.item) {
                        return;
                    }

                    // Search for a match (case-insensitive)
                    var value = this.input.val(),
                      valueLowerCase = value.toLowerCase(),
                      valid = false;
                    this.element.children("option").each(function () {
                        if ($(this).text().toLowerCase() === valueLowerCase) {
                            this.selected = valid = true;
                            return false;
                        }
                    });

                    // Found a match, nothing to do
                    if (valid) {
                        return;
                    }

                    // Remove invalid value
                    this.input
                      .val("")
                      .attr("title", value + " didn't match any item")
                      .tooltip("open");
                    this.element.val("");
                    this._delay(function () {
                        this.input.tooltip("close").attr("title", "");
                    }, 2500);
                    this.input.autocomplete("instance").term = "";
                },

                _destroy: function () {
                    this.wrapper.remove();
                    this.element.show();
                }
            });
        })(jQuery);

        $(function () {
            $('.combobox').combobox();
            $("toggle").click(function () {
                $("#combobox").toggle();
            });
        });
    </script>
</body>
</html>
